#include "stdafx.h"
#include "DlgStatus.h"


CDlgStatus::CDlgStatus()
	:SHostDialog(_T("LAYOUT:XML_STATUSDLG"))	
	, iValue(0)
{
}


CDlgStatus::~CDlgStatus()
{
}


BOOL CDlgStatus::OnInitDialog(HWND wndFocus, LPARAM lInitParam)
{
	m_ctrlProgress = FindChildByName2<SProgress>(_T("prog"));
	SASSERT(m_ctrlProgress);
	/*m_pUserName = FindChildByName2<SEdit>(_T("username"));
	SASSERT(m_pUserName);

	m_pPassWord = FindChildByName2<SEdit>(_T("password"));
	SASSERT(m_pPassWord);

	m_pCue = FindChildByName2<SStatic>(_T("cueText"));
	SASSERT(m_pCue);

	m_pProgress = FindChildByName2<SAnimateImgWnd>(_T("progress"));
	SASSERT(m_pProgress);

	m_pLogin = FindChildByName2<SImageButton>(_T("btn_login"));
	SASSERT(m_pLogin);
	*/
	SetTimer(1, 500);
	return TRUE;
}

void CDlgStatus::SetPorgressValues(int iValue)
{
	m_ctrlProgress->SetValue(iValue);
}


void CDlgStatus::OnClose()
{
	OnCancel();
}


void CDlgStatus::OnTimer(UINT_PTR idEvent)
{
	SetMsgHandled(FALSE);
	if (idEvent == 1)
	{
		iValue++;
		m_ctrlProgress->SetValue(iValue);
		if (iValue == 100)
		{
			KillTimer(1);
		}
	}

}
